Skip to content

Add definitions for the new HTTP QUERY method per RFC 10008 - #3654

Open
gwynne wants to merge 1 commit into
apple:mainfrom
gwynne:rfc-10008-http-query-method
Open

Add definitions for the new HTTP QUERY method per RFC 10008#3654
gwynne wants to merge 1 commit into
apple:mainfrom
gwynne:rfc-10008-http-query-method

Conversation

@gwynne

@gwynne gwynne commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Adds definitions for the QUERY method defined in RFC 10008 to HTTPMethod.

Motivation:

The method has already been added to swift-http-types; this addition maintains parity for SwiftNIO.

Modifications:

The method definition has been added to HTTPMethod and marked as always having a request body. Awareness of it was also added to HTTPDecoder, as the llhttp library already has a constant defined for it.

Result:

The new definition becomes publicly available.

⚠️ I am aware that adding a new case to an existing public enum not marked with @nonexhaustive is technically considered a source-breaking change. I believe the risk of actual compatibility issues for this change is minimal, as it seems unlikely that clients would be functionally making use of HTTPMethod in an exhaustive fashion, but I recognize that this PR may nonetheless be rejected on that basis.

@Lukasa Lukasa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think we can't take this per our current rules. However, it would be interesting to investigate whether the nonexhaustive enum feature can be retroactively added without breaking the API. If it can then we could consider making the enum nonexhaustive, which would resolve our problem.

@gwynne

gwynne commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Definitely worth investigating, I will look into that! But there is the caveat that SE-0487 didn't land until Swift 6.2.3, so at minimum it would have to wait for the release of Swift 6.4 so that NIO can require 6.2 as a minimum supported version.

@gwynne

gwynne commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

So I actually went and read SE-0487 more closely, and unfortunately it explicitly states that adding @nonexhaustive is API-breaking, and while there is @nonexhaustive(warn), it's purely advisory.

Weren't you one of the authors of SE-0487? 🤨

@FranzBusch

Copy link
Copy Markdown
Member

Yeah you cannot add @nonexhaustive to an existing frozen enum (even if implicitly frozen). We added @nonexhaustive(warn) which will produce a warning but even then you cannot add a new case without breaking clients that exhaustively switch over it.

It might be worth doing a Github search seeing how many packages actually exhaustively switch over this to evaluate if we might get away with a potential break here.

@gwynne

gwynne commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Yeah, that was exactly my thinking—how many people are actually exhaustively switching over the list of HTTP methods? I wouldn't call it conclusive yet, but with a cursory Github search, I so far can't find anyone doing it, other than the tests in forks of NIO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants